package org.zezs.sync.mongo.utils;

import org.zezs.sync.mongo.RunTimeUtil;

import java.io.IOException;
import java.io.InputStream;

public class InputStreamUtil {

    public static byte[] readAll(String path) throws IOException {
        InputStream resourceAsStream = RunTimeUtil.class.getResourceAsStream(path);
        int available = resourceAsStream.available();
        byte[] copyToByteArray = new byte[available];
        resourceAsStream.read(copyToByteArray);
        return copyToByteArray;
    }
}
